package com.examples.springboot.jpa.pojos;

import com.examples.springboot.jpa.domain.Mount;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

@Builder
@Getter
@Setter
@AllArgsConstructor
@NoArgsConstructor
public class MountVo {
  public String id;
  public String alias;
  public String name;

  public MountVo(Mount mount) {
    this(mount.getId(),
        mount.getAlias(),
        mount.getName()
    );
  }

  public Mount toMount() {
    return Mount
        .builder()
        .id(id)
        .alias(alias)
        .name(name)
        .build();
  }

  @Override
  public String toString() {
    return name;
  }
}
